<?php

require_once dirname(__FILE__).'/../lib/photosGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/photosGeneratorHelper.class.php';

/**
 * photos actions.
 *
 * @package    jobeet
 * @subpackage photos
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $
 */
class photosActions extends autoPhotosActions
{
    public function executeListByAlbum( sfWebRequest $request )
    {
        if ($iId = $request -> getParameter('id') )
        {
            $this -> setFilters (array('album_id' => $iId));
            $this -> redirect('@photos');
        }
        
        $this -> redirect(url_for('@albums'));        
    }
    
    public function executeNew ( sfWebRequest $request )
    {
        parent::executeNew( $request );
        
        $aFilter = $this->getFilters();
        $this->form->setDefault('album_id', $aFilter['album_id']);              
    }
}
